#include <iostream>
#include <algorithm>
using namespace std;

typedef long long LL;

const int N = 2e5 + 10;

int T, n;
int a[N];

int main()
{
	cin >> T;
	while(T--)
	{
		cin >> n;
		int cnt1 = 0, cnt2 = 0;
		for(int i = 1; i <= n; i++) 
		{
			cin >> a[i];
			if(a[i] % 2 == 0) cnt1++;
			else cnt2++;
		}
		sort(a + 1, a + 1 + n);
//		if(n == 1) cout << a[1] << endl;
		if(cnt1 == 0 || cnt2 == 0) cout << a[n] << endl;
		else
		{
			LL sum = 0;
			for(int i = 1; i <= n; i++) sum += a[i];
			cout << sum - cnt2 + 1 << endl;
		}
	}
	return 0;
}
